/**
 * 2009-12-21 下午09:46:45 
 * esignature
 * com.smc.domain.model
 * Certificate
 */
package com.smc.domain.model;

import java.io.Serializable;

/**
 * @author chenheng
 * @version 0.0.1
 */
/**
 * @hibernate.mapping
 * schema="esignature"
 * @hibernate.class
 * table="t_certification"
 * dynamic-update="true"
 * dynamic-insert="true"
 * select-before-update="true"
 */
public class Certification implements Serializable {
	/**
	 * @hibernate.id
	 * generator-class="uuid"
	 */
	private String uuid ;
	/**
	 * @hibernate.many-to-one
	 * column="user_uuid"
	 * unique="true"
	 */
	private User user ;
	
	private String userUuid ;
	/**
	 * @hibernate.property
	 */
	private String alias ;
	/**
	 * @hibernate.property
	 */
	private String keyalg ;
	/**
	 * @hibernate.property
	 * sigalg算法跟keyalg算法相关；
	 * 假如私有钥匙是"DSA"类型,缺省签名算法是"SHA1withDSA"；
	 * 假如私有钥匙是"RSA"类型,缺省算法是"MD5withRSA"。
	 */
	private String sigalg ;
	/**
	 * @hibernate.property
	 */
	private String keysize ;
	/**
	 * @hibernate.property
	 */
	private String validity ;
	/**
	 * @hibernate.property
	 */
	private String keypass ;
	/**
	 * @hibernate.property
	 */
	private String keystore ;
	/**
	 * @hibernate.property
	 */
	private String storepass ;
	/**
	 * @hibernate.property
	 */
	private String storetype ;
	/**
	 * @hibernate.property
	 */
	private String cn ;
	/**
	 * @hibernate.property
	 */
	private String ou ;
	/**
	 * @hibernate.property
	 */
	private String o ;
	/**
	 * @hibernate.property
	 */
	private String l ;
	/**
	 * @hibernate.property
	 */
	private String st ;
	/**
	 * @hibernate.property
	 */
	private String c ;
	
	private String dname ;
	
	/**
	 * @hibernate.property
	 */
	private boolean authorized;
	
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public String getC() {
		return c;
	}
	public void setC(String c) {
		this.c = c;
	}
	public String getCn() {
		return cn;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public String getDname() {
		setDname();
		return dname;
	}
	public void setDname() {
		this.dname = "cn=" + this.cn + ",ou=" + this.ou + ",o=" + this.o + ",l=" + this.l + ",st=" + this.st + ",c=" + this.c ; 
	}
	public String getKeyalg() {
		return keyalg;
	}
	public void setKeyalg(String keyalg) {
		this.keyalg = keyalg;
	}
	public String getKeypass() {
		return keypass;
	}
	public void setKeypass(String keypass) {
		this.keypass = keypass;
	}
	public String getKeysize() {
		return keysize;
	}
	public void setKeysize(String keysize) {
		this.keysize = keysize;
	}
	public String getKeystore() {
		return keystore;
	}
	public void setKeystore(String keystore) {
		this.keystore = keystore;
	}
	public String getL() {
		return l;
	}
	public void setL(String l) {
		this.l = l;
	}
	public String getO() {
		return o;
	}
	public void setO(String o) {
		this.o = o;
	}
	public String getOu() {
		return ou;
	}
	public void setOu(String ou) {
		this.ou = ou;
	}
	public String getSigalg() {
		return sigalg;
	}
	public void setSigalg(String sigalg) {
		this.sigalg = sigalg;
	}
	public String getSt() {
		return st;
	}
	public void setSt(String st) {
		this.st = st;
	}
	public String getStorepass() {
		return storepass;
	}
	public void setStorepass(String storepass) {
		this.storepass = storepass;
	}
	public String getStoretype() {
		return storetype;
	}
	public void setStoretype(String storetype) {
		this.storetype = storetype;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getValidity() {
		return validity;
	}
	public void setValidity(String validity) {
		this.validity = validity;
	}
	public boolean isAuthorized() {
		return authorized;
	}
	public void setAuthorized(boolean authorized) {
		this.authorized = authorized;
	}
	public String getUserUuid() {
		return userUuid;
	}
	public void setUserUuid(String userUuid) {
		this.userUuid = userUuid;
	}

}
